Content API v2

Build a custom experience from scratch by using our API

Looking for the API v1 documentation? View legacy documentation here

Getting started#

The Content API is only available for customers on our Premium and Agency plans.

Before starting to build a solution using our API, we highly recommend utilizing our pre-designed embed layouts to kickstart your project promptly. These layouts are readily available and can be easily customized using CSS. As an added benefit, we are responsible for keeping these layouts updated to support various content types utilized by different social channels.

If you are looking to build a custom solution from scratch, you can use our Content API to fetch content that you've got collected to Flockler. The API does not provide any content that is hidden or waiting for moderation but only content that you've set to published state.

Authentication#

Even though the content provided by our API is considered to be public content, we require that you create an API key in your Flockler settings. This is so that we have a better understanding on who's using our API and a way to notify API users about updates and breaking changes.

Authenticating requests#

There are to ways to authenticate your requests:

  • Use a HTTP header:X-FL-API-Key: YOUR_API_KEY
  • Use a query parameter:?api_key=YOUR_API_KEY

Endpoints#

This is the base URL for all API requests where the :siteUuid is the UUID of your Flockler:https://api.flockler.app/v2/:siteUuid

Posts#

Request parameters#

ParameterDescription
count
integer

Max number of items returned in the response. Value between 1–100.

?count=20
filterByChannels[]
facebook flickr flockler google_review instagram link linkedin pinterest review rss tiktok twitter youtube

Filter posts by channels.

?filterByChannels[]=twitter&filterByChannels[]=instagram
filterBySectionIds[]
integer

List of section IDs to limit the results to.

?filterBySectionIds[]=1&filterBySectionIds[]=2
filterByTags[]
string

List of tags to limit the results to.

?filterByTags[]=foo&filterByTags[]=bar
tagFilterType
all any

Whether returned posts should have all of the tags mentioned or any of them. The default value is "all".

?tagFilterType=any
order
random

Used to return posts in a random order.

?order=random

Examples#

request
get/posts
const SITE_UUID = 'YOUR_SITE_UUID';
const API_KEY = 'YOUR_API_KEY';
const response = await fetch(
  `https://api.flockler.app/v2/${SITE_UUID}/posts`,
  {
    headers: {
      'X-FL-API-Key': API_KEY
    }
  }
);
const data = await response.json();
response
get/posts
{
  "meta": {
    "statsApiEndpoint": "https://stats-api.flockler.app/v1/stats/YOUR_SITE_UUID?campaignId=…"
  },
  "pagination": {
    "newer": "https://api.flockler.app/v2/YOUR_SITE_UUID/posts?count=12&newerThanCursor=1234567890",
    "older": null
  },
  "posts": [
    {
      "attachments": [],
      "flocklerId": 1234567890,
      "from": {
        "name": "Flockler",
        "username": "getflockler",
        "profileUrl": "https://example.org/getflockler",
        "profileImageUrl": "https://example.org/getflockler.jpg"
      },
      "channel": "flockler",
      "ctaLink": null,
      "images": [
        {
          "altText": null,
          "url": "https://example.org/example.jpg"
        }
      ],
      "postType": "image",
      "publishedAt": "2025-10-20T15:18:06.070Z",
      "sourceId": "2dxsk8fx",
      "sourceUrl": "https://example.org/2dxsk8fx",
      "tags": [
        "HashtagA",
        "HashtagB",
      ],
      "textPlain": "Example text

#HashtagA #HashtagB",
      "textRich": "<p>Example text</p><p>#HashtagA #HashtagB</p>",
      "title": null,
      "videos": [],
      "pinnedIndex": null,
    }
  ]
}

Typescript definition for the posts#

type FlocklerPost = { attachments: PostAttachment[]; flocklerId: number; from: { name: string | null; username: string | null; profileUrl: string | null; profileImageUrl: string | null; }; channel: | 'facebook' | 'flickr' | 'flockler' | 'google_review' | 'instagram' | 'link' | 'linkedin' | 'pinterest' | 'review' | 'rss' | 'tiktok' | 'twitter' | 'vimeo' | 'youtube'; ctaLink: { url: string; title: string | null; } | null; images: { altText: string | null; url: string; }[]; pinnedIndex: number | null; postType: string; publishedAt: string; sourceId: string | null; sourceUrl: string; tags: string[]; textRich: string | null; textPlain: string | null; title: string | null; videos: { type: 'file' | 'iframe' | 'link'; url: string; }[]; }; type FacebookReviewAttachment = { pageName: string; pageUrl: string; recommendationType: 'positive' | 'negative'; type: 'review'; }; type FlocklerRatingAttachment = { rating: number; type: 'rating'; }; interface InstagramStoryAttachment { type: 'storyItem'; publishedAt: string; videoUrl: string; imageUrl: string; }; type LinkAttachment = { type: 'link'; snippet: string; title: string; url: string; }; type PostAttachment = FacebookReviewAttachment | FlocklerRatingAttachment | InstagramStoryAttachment | LinkAttachment;

Feeds#

The Feeds API allows you to manage your social media feeds and pull posts automatically to make them available in a section. You can then use the posts endpoint (described above) to retrieve the content.

List Feeds#

Retrieve a list of all active feeds in your Flockler account.

Request parameters#

ParameterDescription
order
asc desc

Sort feeds by creation date. Default value is "desc".

?order=asc
services[]
twitter_v2 instagram_graph_api instagram_basic_display facebook pinterest youtube rss tiktok google_review linkedin bluesky

Filter feeds by service type. You can specify multiple services.

?services[]=twitter_v2&services[]=instagram_graph_api
request
get/feeds
const SITE_UUID = 'YOUR_SITE_UUID';
const API_KEY = 'YOUR_API_KEY';
const response = await fetch(
  `https://api.flockler.app/v2/${SITE_UUID}/feeds?order=desc&services[]=twitter_v2&services[]=instagram_graph_api`,
  {
    headers: {
      'X-FL-API-Key': API_KEY
    }
  }
);
const data = await response.json();
response
get/feeds

{
  "result": {
    "success": true,
    "data": {
      "feeds": [
        {
          "feed": {
            "id": 123,
            "uuid": "196ae3487ee06b38b2b911f722ce3d0c",
            "name": "BBC News",
            "service": "rss",
            "created_at": "2025-05-08T04:43:21Z",
            "status": {
              "is_healthy": true,
              "error_message": ""
            },
            "configuration": {
              "moderation": "auto_publish",
              "enabled": true
            }
          },
          "section": {
            "id": 456,
            "uuid": "196ae335a5d0871ceaa3db7eac6a4007",
            "name": "Posts"
          }
        },
        {
          "feed": {
            "id": 124,
            "uuid": "196ae35a41a0102a883740a2ce44a041",
            "name": "",
            "service": "instagram_graph_api",
            "created_at": "2025-05-08T04:44:33Z",
            "status": {
              "is_healthy": true,
              "error_message": ""
            },
            "configuration": {
              "moderation": "auto_publish",
              "enabled": true
            }
          },
          "section": {
            "id": 456,
            "uuid": "196ae335a5d0871ceaa3db7eac6a4007",
            "name": "Posts"
          }
        }
      ]
    }
  }
}

Typescript definition for the feeds list#

type FeedService = | 'twitter_v2' | 'instagram_graph_api' | 'instagram_basic_display' | 'facebook' | 'pinterest' | 'youtube' | 'rss' | 'tiktok' | 'google_review' | 'linkedin' | 'bluesky'; type FeedStatus = { is_healthy: boolean; error_message: string; }; type FeedConfiguration = { moderation: 'saved_to_inbox' | 'ai_moderation' | 'auto_publish'; enabled: boolean; }; type Feed = { id: number; uuid: string; name: string; service: FeedService; created_at: string; status: FeedStatus; configuration: FeedConfiguration; }; type Section = { id: number; uuid: string; name: string; }; type FeedWithSection = { feed: Feed; section: Section; }; type ListFeedsResponse = { result: { success: boolean; data: { feeds: FeedWithSection[]; }; }; };

Create Feed#

Request parameters#

ParameterDescription
feed
object

An object containing details about the feed to create.

feed[name]
string

What to name the feed. This should be unique, as it's what you'll see in the Flockler dashboard on your list of active feeds.

feed[feed_type]
rss twitter_v2 instagram facebook

Which type of social media feed to create; i.e. which service to pull content from. Options include rss, twitter_v2, instagram, and facebook feed types.

feed[moderation_type]
saved_to_inbox ai_moderation auto_publish

Defines how the feed content is moderated. Options are saved_to_inbox, ai_moderation, or auto_publish.

feed[feed_attributes]
object

Contains additional parameters specific to the feed type, such as the URL for RSS feeds.

section
object

An object containing details about the section to create or reference.

section[id]
number

The ID of the section where the feed will be added. If you want to use an existing section, provide only the ID.

section[uuid]
string

The UUID of the section where the feed will be added. If you want to use an existing section, provide only the UUID.

section[name]
string

The name of the section to create a new section. Use this only if you want to create a new section instead of using an existing one.

Examples#

RSS Feed Example#

Feed AttributeDescription
urlThe URL of the RSS feed to pull content from.
request
post/feeds
const SITE_UUID = 'YOUR_SITE_UUID';
const API_KEY = 'YOUR_API_KEY';
const postData = {
  feed: {
    name: "BBC",
    feed_type: "rss",
    moderation_type: "auto_publish",
    feed_attributes: {
      url: "https://feeds.bbci.co.uk/news/world/rss.xml"
    }
  },
  section: {
    id: 456
  }
};

const response = await fetch(
  `https://api.flockler.app/v2/${SITE_UUID}/feeds`,
  {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'X-FL-API-Key': API_KEY
    },
    body: JSON.stringify(postData)
  }
);

const data = await response.json();
response
post/feeds

{
    "result": {
        "success": true,
        "data": {
            "feed": {
                "id": 123,
                "uuid": "uuid",
                "name": "BBC",
                "service": "rss"
            },
            "section": {
                "id": 456,
                "uuid": "uuid",
                "name": "wow"
            }
        }
    }
}
          

Typescript definition for this request#

type FeedAttributes = { url: string; // ...other params for other feed types... }; type Feed = { id: number; name: string; feed_type: 'rss' moderation_type: 'saved_to_inbox' | 'ai_moderation' | 'auto_publish'; feed_attributes: FeedAttributes; }; type Section = { id: number; uuid: string; }; type CreateFeedRequest = { feed: Feed; section: Section; };

Twitter Feed Example#

Feed AttributeDescription
authorThe username of the Twitter account to pull tweets from.
hashtag_or_keywordHashtags or keywords to filter tweets.
include_repliesBoolean flag to include replies in the feed.
videos_requiredBoolean flag to include only tweets with videos.
pictures_requiredBoolean flag to include only tweets with pictures.
request
post/feeds
const SITE_UUID = 'YOUR_SITE_UUID';
const API_KEY = 'YOUR_API_KEY';
const postData = {
  feed: {
    name: "Twitter feed",
    feed_type: "twitter_v2",
    moderation_type: "auto_publish",
    feed_attributes: {
      author: "author",
      hashtag_or_keyword: "#hashtag",
      include_replies: true,
      videos_required: true,
      pictures_required: true
    }
  },
  section: {
    id: 456
  }
};

const response = await fetch(
  `https://api.flockler.app/v2/${SITE_UUID}/feeds`,
  {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'X-FL-API-Key': API_KEY
    },
    body: JSON.stringify(postData)
  }
);

const data = await response.json();
response
post/feeds

{
    "result": {
        "success": true,
        "data": {
            "feed": {
                "id": 124,
                "uuid": "uuid",
                "name": "twitter_v2",
                "service": "twitter_v2"
            },
            "section": {
                "id": 456,
                "uuid": "uuid",
                "name": "test"
            }
        }
    }
}

Typescript definition for this request#

type FeedAttributes = { url: string; author?: string; hashtag_or_keyword?: string; include_replies?: boolean; videos_required?: boolean; pictures_required?: boolean; }; type Feed = { name: string; feed_type: 'rss' moderation_type: 'saved_to_inbox' | 'ai_moderation' | 'auto_publish'; feed_attributes: FeedAttributes; }; type Section = { uuid: string; }; type CreateFeedRequest = { feed: Feed; section: Section; };

Pinterest Feed Example#

Feed AttributeDescription
urlAdd Pinterest user or board URL, e.g., https://www.pinterest.com/user/board.
request
post/feeds
const SITE_UUID = 'YOUR_SITE_UUID';
const API_KEY = 'YOUR_API_KEY';
const postData = {
  feed: {
    name: "Pinterest feed",
    feed_type: "pinterest",
    moderation_type: "auto_publish",
    feed_attributes: {
      url: "https://www.pinterest.com/user/board"
    }
  },
  section: {
    id: 456
  }
};

const response = await fetch(
  `https://api.flockler.app/v2/${SITE_UUID}/feeds`,
  {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'X-FL-API-Key': API_KEY
    },
    body: JSON.stringify(postData)
  }
);

const data = await response.json();
response
post/feeds

{
    "result": {
        "success": true,
        "data": {
            "feed": {
                "id": 125,
                "uuid": "uuid",
                "name": "Pinterest feed",
                "service": "pinterest"
            },
            "section": {
                "id": 456,
                "uuid": "uuid",
                "name": "example_section"
            }
        }
    }
}

Instagram Feed Example#

Instagram feeds require a Facebook account connected to use Instagram Graph API. Business mentions and stories require an Instagram Business Account linked to a Facebook Page as well as admin rights to this account.

Instagram feeds support multiple filter types to fetch different types of content. Choose the filter type that best matches your use case.

Filter TypeRequired AttributesOptional AttributesDescription
usernameusernamehashtagFetch posts from a specific account
hashtaghashtagusernameFetch posts with a specific hashtag
business_mentionsusernamehashtagFetch mentions of your business
business_storiesusername-Fetch your business stories
Feed AttributeDescription
filter_type
username hashtag business_mentions business_stories
The type of Instagram content to fetch. Determines which filter_attributes are required.
filter_attributes
object
Contains parameters specific to the filter_type. Structure varies by filter type.
media_type
all image video
Filter posts by media type. Default is "all".

Username Feed Example#

request
post/feeds
const SITE_UUID = 'YOUR_SITE_UUID';
const API_KEY = 'YOUR_API_KEY';
const postData = {
  feed: {
    name: "Company Instagram",
    feed_type: "instagram",
    moderation_type: "auto_publish",
    feed_attributes: {
      filter_type: "username",
      filter_attributes: {
        username: "company_account"
      },
      media_type: "all"
    }
  },
  section: {
    id: 456
  }
};

const response = await fetch(
  `https://api.flockler.app/v2/${SITE_UUID}/feeds`,
  {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'X-FL-API-Key': API_KEY
    },
    body: JSON.stringify(postData)
  }
);

const data = await response.json();
response
post/feeds

{
    "result": {
        "success": true,
        "data": {
            "feed": {
                "id": 126,
                "uuid": "uuid",
                "name": "Company Instagram",
                "service": "instagram_graph_api"
            },
            "section": {
                "id": 456,
                "uuid": "uuid",
                "name": "instagram_section"
            }
        }
    }
}

Hashtag Feed Example#

request
post/feeds
const SITE_UUID = 'YOUR_SITE_UUID';
const API_KEY = 'YOUR_API_KEY';
const postData = {
  feed: {
    name: "Summer Campaign",
    feed_type: "instagram",
    moderation_type: "auto_publish",
    feed_attributes: {
      filter_type: "hashtag",
      filter_attributes: {
        hashtag: "summer2025"
      },
      media_type: "image"
    }
  },
  section: {
    id: 456
  }
};

const response = await fetch(
  `https://api.flockler.app/v2/${SITE_UUID}/feeds`,
  {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'X-FL-API-Key': API_KEY
    },
    body: JSON.stringify(postData)
  }
);

const data = await response.json();
response
post/feeds

{
    "result": {
        "success": true,
        "data": {
            "feed": {
                "id": 127,
                "uuid": "uuid",
                "name": "Summer Campaign",
                "service": "instagram_graph_api"
            },
            "section": {
                "id": 456,
                "uuid": "uuid",
                "name": "campaign_section"
            }
        }
    }
}

Business Mentions Feed Example#

Note: Requires a connected Facebook account with Instagram Business Account and Facebook Page access token. The username must be an Instagram account connected to your Facebook account.

request
post/feeds
const SITE_UUID = 'YOUR_SITE_UUID';
const API_KEY = 'YOUR_API_KEY';
const postData = {
  feed: {
    name: "Brand Mentions",
    feed_type: "instagram",
    moderation_type: "auto_publish",
    feed_attributes: {
      filter_type: "business_mentions",
      filter_attributes: {
        username: "instagram_username",
        hashtag: "ourproduct"
      },
      media_type: "all"
    }
  },
  section: {
    id: 456
  }
};

const response = await fetch(
  `https://api.flockler.app/v2/${SITE_UUID}/feeds`,
  {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'X-FL-API-Key': API_KEY
    },
    body: JSON.stringify(postData)
  }
);

const data = await response.json();
response
post/feeds

{
    "result": {
        "success": true,
        "data": {
            "feed": {
                "id": 128,
                "uuid": "uuid",
                "name": "Brand Mentions",
                "service": "instagram_graph_api"
            },
            "section": {
                "id": 456,
                "uuid": "uuid",
                "name": "mentions_section"
            }
        }
    }
}

Business Stories Feed Example#

Note: Requires a connected Facebook account with Instagram Business Account. The username must be an Instagram account connected to your Facebook account.

request
post/feeds
const SITE_UUID = 'YOUR_SITE_UUID';
const API_KEY = 'YOUR_API_KEY';
const postData = {
  feed: {
    name: "Our Stories",
    feed_type: "instagram",
    moderation_type: "auto_publish",
    feed_attributes: {
      filter_type: "business_stories",
      filter_attributes: {
        username: "instagram_username"
      },
      media_type: "all"
    }
  },
  section: {
    id: 456
  }
};

const response = await fetch(
  `https://api.flockler.app/v2/${SITE_UUID}/feeds`,
  {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'X-FL-API-Key': API_KEY
    },
    body: JSON.stringify(postData)
  }
);

const data = await response.json();
response
post/feeds

{
    "result": {
        "success": true,
        "data": {
            "feed": {
                "id": 129,
                "uuid": "uuid",
                "name": "Our Stories",
                "service": "instagram_graph_api"
            },
            "section": {
                "id": 456,
                "uuid": "uuid",
                "name": "stories_section"
            }
        }
    }
}

TypeScript definition for Instagram feeds#

// Instagram Feed Request Types export interface InstagramFeedRequest { name: string; feed_type: 'instagram'; moderation_type?: 'auto_publish' | 'ai_moderation' | null; feed_attributes: InstagramFeedAttributes; } export interface InstagramFeedAttributes { filter_type?: 'username' | 'hashtag' | 'business_mentions' | 'business_stories'; filter_attributes?: FilterAttributes; media_type?: 'all' | 'image' | 'video'; } // Filter Attributes by Type export type FilterAttributes = | UsernameFilterAttributes | HashtagFilterAttributes | BusinessMentionsFilterAttributes | BusinessStoriesFilterAttributes; export interface UsernameFilterAttributes { username: string; // Required hashtag?: string; // Optional } export interface HashtagFilterAttributes { hashtag: string; // Required username?: string; // Optional } export interface BusinessMentionsFilterAttributes { username: string; // Required hashtag?: string; // Optional } export interface BusinessStoriesFilterAttributes { username: string; // Required } // Response Types type InstagramFeedResponse = { result: { success: boolean; data: { feed: { id: number; uuid: string; name: string; service: 'instagram_graph_api'; }; section: { id: number; uuid: string; name: string; }; }; }; };

Error Handling for Instagram Feeds#

When creating Instagram feeds with business_mentions or business_stories filter types, the username parameter is required and must be an Instagram account connected to your Facebook account.

If you provide a username that is not connected or invalid, the API will return an error response that includes a list of available Instagram accounts connected to your Facebook account.

Error Response Example#

{ "error": "Instagram account @invaliduser is not connected to your Facebook account. Available accounts: @user1, @user2" }

Use one of the available usernames from the error message to create your feed successfully.

Facebook Feed Example#

Facebook feeds require a Facebook account connected to the platform. Connection tokens are valid for 48 hours. For my_page feeds, you must have admin access to the specified Facebook page.

Facebook feeds support two filter types to fetch different types of content from Facebook pages. Choose the filter type that best matches your use case.

Filter TypeRequired AttributesOptional AttributesDescription
my_pagefacebook_page_id, ownershiphashtagFetch from your own Facebook page
public_pagefacebook_page_idhashtagFetch from any public Facebook page

You can find the Facebook Page ID on the Facebook Page: About → Page transparency → Page ID.

Ownership Types (My Page Only)#

OwnershipDescriptionHashtag filtering support
company_postsPosts published by your page✅ Yes
public_mentionsPosts where your page is mentioned✅ Yes
page_ratingsCustomer reviews/ratings❌ No
Feed AttributeDescription
filter_type
my_page public_page
The type of Facebook content to fetch. Determines which filter_attributes are required.
filter_attributes
object
Contains parameters specific to the filter_type. For my_page, includes ownership type.

My Page Feed Example - Company Posts#

request
post/feeds
const SITE_UUID = 'YOUR_SITE_UUID';
const API_KEY = 'YOUR_API_KEY';
const postData = {
  feed: {
    name: "My Company Posts",
    feed_type: "facebook",
    moderation_type: "auto_publish",
    feed_attributes: {
      filter_type: "my_page",
      filter_attributes: {
        facebook_page_id: "123456789012345",
        ownership: "company_posts"
      }
    }
  },
  section: {
    id: 456
  }
};

const response = await fetch(
  `https://api.flockler.app/v2/${SITE_UUID}/feeds`,
  {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'X-FL-API-Key': API_KEY
    },
    body: JSON.stringify(postData)
  }
);

const data = await response.json();
response
post/feeds

{
    "result": {
        "success": true,
        "data": {
            "feed": {
                "id": 130,
                "uuid": "uuid",
                "name": "My Company Posts",
                "service": "facebook"
            },
            "section": {
                "id": 456,
                "uuid": "uuid",
                "name": "facebook_section"
            }
        }
    }
}

My Page Feed Example - Public Mentions#

request
post/feeds
const SITE_UUID = 'YOUR_SITE_UUID';
const API_KEY = 'YOUR_API_KEY';
const postData = {
  feed: {
    name: "Brand Mentions",
    feed_type: "facebook",
    moderation_type: "auto_publish",
    feed_attributes: {
      filter_type: "my_page",
      filter_attributes: {
        facebook_page_id: "123456789012345",
        ownership: "public_mentions",
        hashtag: "ourproduct"
      }
    }
  },
  section: {
    id: 456
  }
};

const response = await fetch(
  `https://api.flockler.app/v2/${SITE_UUID}/feeds`,
  {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'X-FL-API-Key': API_KEY
    },
    body: JSON.stringify(postData)
  }
);

const data = await response.json();
response
post/feeds

{
    "result": {
        "success": true,
        "data": {
            "feed": {
                "id": 131,
                "uuid": "uuid",
                "name": "Brand Mentions",
                "service": "facebook"
            },
            "section": {
                "id": 456,
                "uuid": "uuid",
                "name": "mentions_section"
            }
        }
    }
}

My Page Feed Example - Page Ratings#

Note: Hashtag filtering is not supported for page ratings.

request
post/feeds
const SITE_UUID = 'YOUR_SITE_UUID';
const API_KEY = 'YOUR_API_KEY';
const postData = {
  feed: {
    name: "Customer Reviews",
    feed_type: "facebook",
    moderation_type: "auto_publish",
    feed_attributes: {
      filter_type: "my_page",
      filter_attributes: {
        facebook_page_id: "123456789012345",
        ownership: "page_ratings"
      }
    }
  },
  section: {
    id: 456
  }
};

const response = await fetch(
  `https://api.flockler.app/v2/${SITE_UUID}/feeds`,
  {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'X-FL-API-Key': API_KEY
    },
    body: JSON.stringify(postData)
  }
);

const data = await response.json();
response
post/feeds

{
    "result": {
        "success": true,
        "data": {
            "feed": {
                "id": 132,
                "uuid": "uuid",
                "name": "Customer Reviews",
                "service": "facebook"
            },
            "section": {
                "id": 456,
                "uuid": "uuid",
                "name": "reviews_section"
            }
        }
    }
}

Public Page Feed Example#

request
post/feeds
const SITE_UUID = 'YOUR_SITE_UUID';
const API_KEY = 'YOUR_API_KEY';
const postData = {
  feed: {
    name: "Competitor Feed",
    feed_type: "facebook",
    moderation_type: "auto_publish",
    feed_attributes: {
      filter_type: "public_page",
      filter_attributes: {
        facebook_page_id: "987654321098765",
        hashtag: "news"
      }
    }
  },
  section: {
    id: 456
  }
};

const response = await fetch(
  `https://api.flockler.app/v2/${SITE_UUID}/feeds`,
  {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'X-FL-API-Key': API_KEY
    },
    body: JSON.stringify(postData)
  }
);

const data = await response.json();
response
post/feeds

{
    "result": {
        "success": true,
        "data": {
            "feed": {
                "id": 133,
                "uuid": "uuid",
                "name": "Competitor Feed",
                "service": "facebook"
            },
            "section": {
                "id": 456,
                "uuid": "uuid",
                "name": "competitor_section"
            }
        }
    }
}

TypeScript definition for Facebook feeds#

// Facebook Feed Request Types export interface FacebookFeedRequest { name: string; feed_type: 'facebook'; moderation_type?: 'auto_publish' | 'ai_moderation' | null; feed_attributes: FacebookFeedAttributes; } export interface FacebookFeedAttributes { filter_type?: 'my_page' | 'public_page'; filter_attributes?: FilterAttributes; } // Filter Attributes by Type export type FilterAttributes = | MyPageFilterAttributes | PublicPageFilterAttributes; export interface MyPageFilterAttributes { facebook_page_id: string; // Required ownership: 'company_posts' | 'public_mentions' | 'page_ratings'; // Required hashtag?: string; // Optional (not supported for page_ratings) } export interface PublicPageFilterAttributes { facebook_page_id: string; // Required hashtag?: string; // Optional } // Response Types type FacebookFeedResponse = { result: { success: boolean; data: { feed: { id: number; uuid: string; name: string; service: 'facebook'; }; section: { id: number; uuid: string; name: string; }; }; }; };